package com.weidey.blogWeb.controller;

import com.weidey.blogWeb.domain.WebGroup;
import com.weidey.blogWeb.service.IWebGroupService;
import com.weidey.common.core.controller.BaseController;
import com.weidey.common.core.domain.AjaxResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 文章分组(WebGroup)表控制层
 */
//@Api(tags = "文章分组")
@RestController
@RequestMapping("/blog/web/group")
public class WebGroupController extends BaseController {
    @Resource
    private IWebGroupService blogWebGroupService;

//    @ApiOperation("获取文章分组")
    @GetMapping("/select/all")
    public AjaxResult selectGroup(){
        //TODO
        List<WebGroup> blogWebGroups =  blogWebGroupService.getBlogGroup();
        return AjaxResult.success(blogWebGroups);
    }

//    @ApiOperation("根据id获取文章分组")
    @GetMapping("/select")
    public AjaxResult selectGroupById(@RequestParam("articleId") int articleId){
        //TODO
      WebGroup blogWebGroups =  blogWebGroupService.getBlogGroupById(articleId);
        return AjaxResult.success(blogWebGroups);
    }
}
